#include "tomduff.h"

int TomDuff(int16_t *from,int16_t *to,uint16_t len)
{
	uint32_t r,n;
    r = n = (len + 7) >> 3;
	switch(len&7)
	{
	case 0:do{ *to++ = *from++;
	case 7:    *to++ = *from++;
	case 6:    *to++ = *from++;
	case 5:    *to++ = *from++;
	case 4:    *to++ = *from++;
	case 3:    *to++ = *from++;
	case 2:    *to++ = *from++;
	case 1:    *to++ = *from++;
		   }while(--n > 0);
	}
	return r;
}
